import Cookies from 'js-cookie'
import qs from "qs";

const TokenKey = "ikness_user_token"

export function getToken(){
    return Cookies.get(TokenKey)
}

export function setToken(token) {
    return Cookies.set(TokenKey, token)
}

export function removeToken() {
    return Cookies.remove(TokenKey)
}

const userKey = "ikness_user"
export function getUser(){
    return Cookies.get(userKey)
}

export function setUser(user) {
    return Cookies.set(userKey, qs.stringify(user))
}

export function removeUser() {
    return Cookies.remove(userKey)
}
